package cn.tedu.sp02.service;

import cn.tedu.sp01.pojo.Item;
import cn.tedu.sp01.service.ItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;
@Slf4j
@Service
public class ItemServiceImpl implements ItemService {

    @Override
    public List<Item> getItems(String orderId) {
        return Arrays.asList(new Item[]{
            new Item(1,"商品1",1),
            new Item(2,"商品2",1),
            new Item(3,"商品3",1),
            new Item(4,"商品4",1),
            new Item(5,"商品5",1),
        });
    }

    @Override
    public void decreaseNumber(List<Item> items) {
        for(Item item:items){
            log.info("减少库存 - "+item);
        }
    }
}
